home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form DataXess
- BackColor = &H00C0C0C0&
- Caption = "Data Access"
- ClientHeight = 2340
- ClientLeft = 2280
- ClientTop = 3210
- ClientWidth = 7515
- Height = 2745
- Left = 2220
- LinkTopic = "Form1"
- ScaleHeight = 2340
- ScaleWidth = 7515
- Top = 2865
- Width = 7635
- Begin TextBox txtCounter
- Height = 315
- Left = 6000
- TabIndex = 2
- Text = "50"
- Top = 600
- Width = 1300
- End
- Begin CommandButton cmdTrans
- Caption = "Update Records"
- Default = -1 'True
- Height = 450
- Index = 0
- Left = 120
- TabIndex = 0
- Top = 1080
- Width = 1935
- End
- Begin CommandButton cmdTrans
- Caption = "Update w/ *Trans"
- Height = 450
- Index = 1
- Left = 120
- TabIndex = 1
- Top = 1560
- Width = 1935
- End
- Begin Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Records:"
- Height = 195
- Left = 5175
- TabIndex = 8
- Top = 660
- Width = 780
- End
- Begin Label lblTitle
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Use Transaction Statements for Bulk Operations"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00800000&
- Height = 300
- Index = 1
- Left = 240
- TabIndex = 7
- Top = 120
- Width = 6255
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Update records w/o Trans"
- Height = 255
- Index = 0
- Left = 2160
- TabIndex = 6
- Top = 1200
- Width = 3200
- End
- Begin Label lblTrans
- BackStyle = 0 'Transparent
- Caption = "00.00 secs"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00800000&
- Height = 255
- Index = 0
- Left = 6000
- TabIndex = 5
- Top = 1200
- Width = 1300
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Use BeginTrans && CommitTrans"
- Height = 255
- Index = 1
- Left = 2160
- TabIndex = 4
- Top = 1680
- Width = 3200
- End
- Begin Label lblTrans
- BackStyle = 0 'Transparent
- Caption = "00.00 secs"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00800000&
- Height = 255
- Index = 1
- Left = 6000
- TabIndex = 3
- Top = 1680
- Width = 1300
- End
- Sub cmdTrans_Click (Index As Integer)
- 'If Index=1, we include a BeginTrans/CommitTrans wrapper
- 'around the update loop
- Dim db As Database
- Dim tb As Table
- Set db = OpenDatabase("c:\vb\biblio.mdb")
- Set tb = db.OpenTable("Authors")
- screen.MousePointer = 11
- Start# = Timer
- If Index = 1 Then BeginTrans
- For Counter = 1 To Val(txtCounter)
- tb.AddNew
- tb("Author") = Str(Counter)
- tb.Update
- Next Counter
- If Index = 1 Then CommitTrans
- Finish# = Timer
- lblTrans(Index) = Format$(Finish# - Start#, "##.##") & " secs."
- screen.MousePointer = 0
- tb.Close
- db.Close
- End Sub
- Sub Form_Load ()
- ' Center the form.
- Me.Left = (screen.Width - Me.Width) / 2
- Me.Top = (screen.Height - Me.Height) / 2
- End Sub
-